package com.example.demo.zabbix.request.builder.host;

import com.example.demo.zabbix.request.BaseRequest;
import com.example.demo.zabbix.request.builder.request.RequestBuilder;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/hostgroup/massupdate
 */
public class HostGroupMassUpdateRequestBuilder extends RequestBuilder<Map<String,Object>> {
    private List<Map<String,Object>> groups;
    public HostGroupMassUpdateRequestBuilder(String auth) {
        super("hostgroup.massupdate", auth);
        baseRequest.setParams(new HashMap<>());
    }

    public HostGroupMassUpdateRequestBuilder(Long id, String auth) {
        super("hostgroup.massupdate", id, auth);
        baseRequest.setParams(new HashMap<>());
    }

    public HostGroupMassUpdateRequestBuilder setParam(String key, Object value){
        baseRequest.getParams().put(key,value);
        return this;
    }

    public HostGroupMassUpdateRequestBuilder setParams(Map<String,Object> params){
        baseRequest.getParams().putAll(params);
        return this;
    }

    public List<Map<String, Object>> getGroups() {
        return groups;
    }

    public HostGroupMassUpdateRequestBuilder setGroups(List<Map<String, Object>> groups) {
        this.groups = groups;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("groups",groups);
        return baseRequest;
    }
}

